export default {
	gscroll    
}

function gscroll(e,bottompx,that,gposition){
	var bodyScrollHeight=0,documentScrollHeight=0;
	bottompx?bottompx:bottompx=0;
	var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
    var windowHeight = document.documentElement.clientHeight;
	// var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
	if (document.body) {
        bodyScrollHeight = document.body.scrollHeight;
    }
    if (document.documentElement) {
        documentScrollHeight = document.documentElement.scrollHeight;
    }
    var scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight;
	if(scrollTop+windowHeight+bottompx>=scrollHeight){
		if(gposition.y-e.changedTouches[0].pageY>100){

			if(that.$refs['gnext']&&that.$refs['gnext'].className&&that.$refs['gnext'].className.length<9){
				$('.aaa').addClass('gbounce')
				setTimeout(function(){that.$refs['gnext'].click();$('.aaa').removeClass('gbounce')},1000);
			}
		}
	}
} 